'''读文件相关的操作'''
import configparser
import os

import yaml


def read_ini(file_path,key):
    file_path = gerealpath() + file_path
    c = configparser.ConfigParser()
    c.read(file_path,encoding='utf-8')
    return c.get("env",key)
def read_yaml(file_path):
    file_path = gerealpath() + file_path
    with open(file_path,mode='r',encoding="utf-8") as f :
        c = f.read()
        return yaml.load(c,Loader=yaml.FullLoader)
def gerealpath():
    return os.path.dirname(os.getcwd()) + "\\"
if __name__ == '__main__':
    # s = read_ini(r"data_env\env.ini", "db")
    # uu = eval(s)
    # print(uu)
    print(read_yaml("data_case/register_fail.yaml"))